import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home/swiper',
    component: () => import('../views/HomeView.vue'),
    children: [
      {
        path: '/swiper',
        component: () => import('../views/page/swiper.vue'),
        meta: { title: '轮播图' },
      },
      {
        path: '/news',
        component: () => import('../views/page/newsView.vue'),
        meta: { title: '新闻管理' },
      },
      {
        path: '/note',
        component: () => import('../views/page/noteView.vue'),
        meta: { title: '公告管理' },
      },
    ],
  },
]

const router = new VueRouter({
  routes,
})

export default router
